package cn.edu.zzuli.common.utils;


import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.HtmlEmail;

/** cfgeeyytqsaxfaje
 * 邮件工具类
 */
public class MailUtil {
    //邮箱验证码
    public static void sendEmail(String name,String emailAddress) throws EmailException {
            HtmlEmail email = new HtmlEmail();//不用更改
            //126邮箱为smtp.126.com,163邮箱为163.smtp.com，QQ为smtp.qq.com
            email.setHostName("smtp.qq.com");
            email.setCharset("UTF-8");
            // 收件地址
            email.addTo(emailAddress);
            //填邮箱地址和用户名
            email.setFrom("1786126421@qq.com", "Campus Running Man");
            //填写邮箱地址和客户端授权码
            email.setAuthentication("1786126421@qq.com", "cfgeeyytqsaxfaje");
            email.setSubject("注册认证消息");//此处填写邮件名，邮件名可任意填写
            email.setMsg(name + "同学你好,你已成功认证,欢迎你使用Campus Running Man 小程序");//此处填写邮件内容
            email.send();
    }
}